package com.hl.sfzy.controller.myController;

import com.hl.sfzy.entity.my.MyConsult;
import com.hl.sfzy.service.myService.MyConsultService;
import com.hl.sfzy.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/my/consult")
public class MyConsultController {
    @Autowired
    private MyConsultService myConsultService;

    @GetMapping("getConsult")
    public R consult(int userId,int pageNo,int pageSize){
        List<MyConsult> myConsults = myConsultService.myConsultList(userId,pageNo,pageSize);
        if (myConsults != null){
            return R.success(myConsults);
        }else {
            return R.failure("查询失败");
        }
    }
}
